#! /bin/bash
read -p "请输入用户名: " user

id $user &>/dev/null
if [ $? -eq 0 ];then
	echo "用户 $user 已存在"
else
	useradd $user
	if [ $? -eq 0 ];then
		echo "$user 创建成功"
	fi
fi
